package br.com.fabrica.aid.aid_fabrica.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Montagem implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private long id;
	@Temporal(TemporalType.DATE)
	private Date dataInicio;
	@Temporal(TemporalType.DATE)
	private Date dataFim;
	@OneToMany(mappedBy="montagem")
	private List<ItemPeca> itens = new ArrayList<ItemPeca>();
	@ManyToOne
	private Colaborador colaborador;
	@OneToOne
	private Homologacao homologacao;
	
	public Montagem() {
		super();
	}

	public Montagem(Date dataInicio, Date dataFim, List<ItemPeca> itens,
			Colaborador colaborador) {
		super();
		this.dataInicio = dataInicio;
		this.dataFim = dataFim;
		this.itens = itens;
		this.colaborador = colaborador;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Date getDataInicio() {
		return dataInicio;
	}

	public void setDataInicio(Date dataInicio) {
		this.dataInicio = dataInicio;
	}

	public Date getDataFim() {
		return dataFim;
	}

	public void setDataFim(Date dataFim) {
		this.dataFim = dataFim;
	}

	public List<ItemPeca> getItens() {
		return itens;
	}

	public void setItens(List<ItemPeca> itens) {
		this.itens = itens;
	}

	public Colaborador getColaborador() {
		return colaborador;
	}

	public void setColaborador(Colaborador colaborador) {
		this.colaborador = colaborador;
	}

	public Homologacao getHomologacao() {
		return homologacao;
	}

	public void setHomologacao(Homologacao homologacao) {
		this.homologacao = homologacao;
	}		

}
